Shader "Level4/Laser/Laser"{
	Properties{
		_MainTex("MainTex",2d) = ""{}
		_NoiseTex("NoiseTex",2d) = ""{}
	}
	
	CGINCLUDE
	#include "UnityCG.cginc"
	
	struct v2f{
		float4 pos : POSITION;
		float4 uv : TEXCOORD;
	};
	
	sampler2D _MainTex;
	sampler2D _NoiseTex;
	
	half4 _MainTex_ST;
	half4 _NoiseTex_ST;
	
	v2f vert(appdata_full v){
		v2f o;
		o.pos = mul(UNITY_MATRIX_MVP,v.vertex);
		//转换纹理坐标.
		o.uv.xy = TRANSFORM_TEX(v.texcoord, _MainTex);
		o.uv.zw = TRANSFORM_TEX(v.texcoord, _NoiseTex);
		return o;
	}
	
	float4 frag(v2f v):COLOR{
		return tex2D(_MainTex,v.uv.xy) * tex2D(_NoiseTex,v.uv.zw);
	}
	
	ENDCG
	
	SubShader{
		Tags { "RenderType" = "Transparent" "Reflection" = "Laser" "Queue" = "Transparent"}
		Cull Off
		ZWrite Off
		Blend SrcAlpha One
		Pass{
			CGPROGRAM
			#pragma vertex vert
			#pragma fragment frag
			ENDCG
		}
	}
}